home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1995 April / macformat-023.iso / Shareware City / Developers / NeoPersist 3.0.8 folder / NeoBench / Includes / NeoBench.h < prev   
Encoding:
C/C++ Source or Header  |  1994-07-19  |  3.1 KB  |  123 lines  |  [TEXT/MMCC]

  1. /****
  2.  * CNeoBenchDoc.h
  3.  *
  4.  *    Document class for a typical application.
  5.  *
  6.  ****/
  7.  
  8. #ifndef _H_NeoBench
  9. #define    _H_NeoBench            /* Include this file only once */
  10. #include <time.h>
  11.  
  12. /*
  13.  * A NeoPhase structure,  containing a target string,
  14.  * number of iterations done,  and a soFar in milliseconds.
  15.  */
  16.  
  17. #define cmdSTOP        1000
  18. #define cmdGO        1001
  19.  
  20. /**
  21.  * Constants that define the locations of the panes that get created
  22.  * And also their spacing.
  23.  **/
  24. #define    H_TOTAL            103    // Vert and Hor positions of top Total
  25. #define    V_TOTAL            57  // Editable textbox
  26.  
  27. #define H_STAT_START    160    // Vert and Hor position of top left
  28. #define V_STAT_START    57    // Static text array
  29.  
  30. #define    V_LINE_POSN        82    // Where the lines are drawn for the
  31.                             // first item.
  32.  
  33. #define H_DIST            80    // Horiz distance between Stat text panes
  34. #define V_DIST            20    // Vertical distance between text panes.
  35.  
  36. #define TOT_WID            50    // Width of Total Edit text boxes
  37. #define TOT_HGT            16    // Height of the Total EditText box
  38.  
  39. #define SIZE_WID        30    // Width of size text edit
  40.  
  41. #define STAT_WID        60    // Width of Static text area
  42. #define STAT_HGT        21    // Height of Static Text area
  43.  
  44. #define STOP_WID        32    // Width of stop button
  45. #define STOP_HGT        32    // Height of stop button
  46. #define STOP_TOP        155 // Top position
  47. #define STOP_LFT        300    // Left position
  48.  
  49. #define GO_WID            32    // Width of Go button
  50. #define GO_HGT            32    // Height of Go button
  51. #define GO_TOP            155 // Top position
  52. #define GO_LFT            335 // Left position
  53.  
  54. #define LEFT_STAT        13    // Left most position of Stat Text
  55.  
  56. #define STAT_HDR_TOP    42    // Top vert position of the Stat Text titles
  57. #define PHASE_NAME_WID  130 // Width of Phase names
  58.  
  59. #define GO_RES_ID         2001 // Res ID of Go button
  60. #define STOP_RES_ID        3001    // Res ID of Stop button
  61.  
  62. #define NeoLeftStyleID    130
  63. #define NeoRightStyleID    131
  64. #define NeoTextStyleID    132
  65.  
  66. #define REC_H            116        // Where "Objects" gets drawn
  67. #define REC_V            25        // Vert posn
  68.  
  69. #define TIME_H            274     // Where "Time" gets printed.
  70. #define TIME_V            25    // Vert posn same as above
  71.  
  72. // Statically declared entities
  73.  
  74. static long default_vals[5] = { 25000, 25000, 25000, 25000, 25000 };
  75. static long default_maxs[5] = { 1000000, 1000000, 1000000, 1000000, 1000000 };
  76.  
  77.  
  78. static Str255 Txts = "\p00";
  79. static Str255 PhaseNames[] = { "\pInsert", "\pLocate Randomly",
  80.                                 "\pLocate Serially", "\pChange", "\pDelete"
  81.                                 };
  82.  
  83. enum phases {
  84.     kNoPhase    = -1,
  85.     kMinPhase    = 0,
  86.     kInsert        = kMinPhase,
  87.     kRandomly,
  88.     kSerially,
  89.     kChange,
  90.     kDelete,
  91.     kMaxPhase    = kDelete
  92. };
  93.  
  94. // Indices into the array going across.  There are three of them
  95. enum cols {
  96.     kMinCol        = 0,
  97.     kTargetCol    = kMinCol,
  98.     kSoFar,
  99.     kPerObject,
  100.     kTotal,
  101.     kMaxCol        = kTotal
  102. };
  103.  
  104. enum states {
  105.     kStop,
  106.     kStart
  107. };
  108.  
  109. typedef struct NeoPhase {
  110.     Boolean    dirty;        /* Do values for this phase need updating?    */
  111.     long    target;        /* Copied from TextBox field in main pane   */
  112.     long    delta;        /* Initial count                            */
  113.     long    done;        /* Number of operations done so far            */
  114.     long    committed;    /* Number of operations committed so far    */
  115.     long    soFar;        /* Total time units in Milliseconds so far    */
  116. } NeoPhase;
  117.  
  118. #define k30MicroMinutes        -(1800000000L)
  119.  
  120. extern long gLoopOverhead;    // Timer Manager Overhead
  121.  
  122. #endif
  123.